package com.session07;

public class NoNameDemo {
    public static void main(String[] args) {
        Person p = new Person();
        p.show(new Message() {      // 匿名内部类
                   public void show() {
                       System.out.println("在匿名内部类中");
                   }
               }
        );
    }
}

class Person {
    public void show(Message msg) {
        msg.show();
    }
}

class Message {
    public void show() {
        System.out.println("在成员内部类中");
    }
}
